home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Tools - Objects / MacApp / MacApp CD Release / MacApp 2.0.1 (Many Libraries) / Interfaces / CIncludes / UMacAppUtilities.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-10-25  |  44.8 KB  |  1,098 lines  |  [TEXT/MPS ]

  1. /*[a-,body+,h-,o=100,r+,rec+,t=4,u+,#+,j=20/57/1$,n-]*/
  2. /* UMacAppUtilities.p */
  3. /* Copyright © 1984-1990  Apple Computer, Inc.  All rights reserved. */
  4. /*
  5. This unit implements a set of simple type declarations and utility
  6. routines.
  7. */
  8. #ifndef  __UMacAppUtilities__
  9. #define __UMacAppUtilities__  0
  10. #endif
  11. #if  ! __UMacAppUtilities__
  12. #define __UMacAppUtilities__  1
  13.  
  14.         /* • Directive settings to EXPORT */
  15. #if  qDebug
  16.         /*$W-*/
  17. #else
  18.         /*$W+*/
  19. #endif
  20. #if  qUnInit
  21.         /*$Init+*/
  22. #else
  23.         /*$Init-*/
  24. #endif
  25. #if  qRangeCheck
  26.         /*$R+*/
  27.         /*$OV+*/
  28. #else
  29.         /*$R-*/
  30.         /*$OV-*/
  31. #endif
  32. #if  qTrace
  33.         /*$D++*/
  34.         /*$N+*/
  35. #else
  36. #if  qNames
  37.         /*$D+*/
  38.         /*$N+*/
  39. #else
  40.         /*$D-*/
  41.         /*$N-*/
  42. #endif
  43. #endif
  44.  
  45.         /* • Auto-Include the requirements for this unit's interface. */
  46. #ifndef  __TEXTEDIT__
  47. #include "TextEdit.h"
  48. #endif
  49. #ifndef  __FILES__
  50. #include "Files.h"
  51. #endif
  52. #ifndef  __TRAPS__
  53. #include "Traps.h"
  54. #endif
  55. #ifndef  __SCRAP__
  56. #include "Scrap.h"
  57. #endif
  58. #ifndef  __ULoMem__
  59. #include "ULoMem.h"
  60. #endif
  61.         /* In the NON-debug case these are set to false and the code they condition will not be
  62.         compiled */
  63. #if  ! qDebug
  64. const short gPreCondition        = false;                /* true to do pre-condition processing */
  65. const short gPostCondition        = false;                /* true to do post-condition processing */
  66. #endif
  67.  
  68.             /* set constants from the standard compiletime variables.
  69.             These constants may be used in expressions such that if the expression stati
  70.    cally evaluates
  71.             to false then the compiler will omit conditioned code.
  72.             if NOT qNeedsColorQD THEN
  73.                 mumble;
  74.             */
  75.             /*[f-]*/
  76.             /* If for some reason these don't come in from MABuild set them to the highest common fo
  77.                rm
  78.             -NoDebug -System6
  79.             */
  80. #ifndef  qDebug
  81. #define qDebug  0
  82. #endif
  83. #ifndef  qDebugTheDebugger
  84. #define qDebugTheDebugger  0
  85. #endif
  86. #ifndef  qInspector
  87. #define qInspector  0
  88. #endif
  89. #ifndef  qMacApp
  90. #define qMacApp  1
  91. #endif
  92. #ifndef  qNames
  93. #define qNames  0
  94. #endif
  95. #ifndef  qNeedsColorQD
  96. #define qNeedsColorQD  0
  97. #endif
  98. #ifndef  qNeedsFPU
  99. #define qNeedsFPU  0
  100. #endif
  101. #ifndef  qNeedsHierarchicalMenus
  102. #define qNeedsHierarchicalMenus  1
  103. #endif
  104. #ifndef  qNeedsMC68020
  105. #define qNeedsMC68020  0
  106. #endif
  107. #ifndef  qNeedsMC68030
  108. #define qNeedsMC68030  0
  109. #endif
  110. #ifndef  qNeedsROM128K
  111. #define qNeedsROM128K  1
  112. #endif
  113. #ifndef  qNeedsScriptManager
  114. #define qNeedsScriptManager  1
  115. #endif
  116. #ifndef  qNeedsStyleTextEdit
  117. #define qNeedsStyleTextEdit  1
  118. #endif
  119. #ifndef  qNeedsWaitNextEvent
  120. #define qNeedsWaitNextEvent  1
  121. #endif
  122. #ifndef  qPerform
  123. #define qPerform  0
  124. #endif
  125. #ifndef  qRangeCheck
  126. #define qRangeCheck  0
  127. #endif
  128. #ifndef  qTemplateViews
  129. #define qTemplateViews  1
  130. #endif
  131. #ifndef  qTrace
  132. #define qTrace  0
  133. #endif
  134.  
  135.             /* Flag that indicates that the user wants to play around with the new, UNSUPPORTED
  136.             stuff that we on the MacApp team are fiddling with.
  137.             WARNING, Setting this flag true voids your MacApp warranty.  It is used to condition
  138.             features that are experimental and UNSUPPORTED.  Features enabled with this flag
  139.             may or may not be included in future versions of MacApp and are here for informational
  140.             purposes only.
  141.             'Nuff said. */
  142.  
  143. #ifndef  qExperimentalAndUnsupported
  144. #define qExperimentalAndUnsupported  0
  145. #endif
  146.  
  147.  
  148. #ifndef  __cplusplus                                    /* in C++ the compile variables can be used
  149.                                                         in expressions */
  150. #if  qDebug
  151. const short qDebug = true;
  152. #else
  153. const short qDebug = false;
  154. #endif
  155.             /* If qDebug then this flag is TRUE else FALSE. */
  156.  
  157. #if  qDebugTheDebugger
  158. const short qDebugTheDebugger = true;
  159. #else
  160. const short qDebugTheDebugger = false;
  161. #endif
  162.             /* If qDebugTheDebugger then this flag is TRUE else FALSE. */
  163.  
  164. #if  qInspector
  165. const short qInspector = true;
  166. #else
  167. const short qInspector = false;
  168. #endif
  169.             /* If qInspector then this flag is TRUE else FALSE. */
  170.  
  171. #if  qMacApp
  172. const short qMacApp = true;
  173. #else
  174. const short qMacApp = false;
  175. #endif
  176.             /* If qMacApp then this flag is TRUE else FALSE. */
  177.  
  178. #if  qNames
  179. const short qNames = true;
  180. #else
  181. const short qNames = false;
  182. #endif
  183.             /* If qNames then this flag is TRUE else FALSE. */
  184.  
  185. #if  qNeedsColorQD
  186. const short qNeedsColorQD = true;
  187. #else
  188. const short qNeedsColorQD = false;
  189. #endif
  190.             /* If qNeedsColorQD then this flag is TRUE else FALSE. */
  191.  
  192. #if  qNeedsFPU
  193. const short qNeedsFPU = true;
  194. #else
  195. const short qNeedsFPU = false;
  196. #endif
  197.             /* If qNeedsFPU then this flag is TRUE else FALSE. */
  198.  
  199. #if  qNeedsHierarchicalMenus
  200. const short qNeedsHierarchicalMenus = true;
  201. #else
  202. const short qNeedsHierarchicalMenus = false;
  203. #endif
  204.             /* If qNeedsHierarchicalMenus then this flag is TRUE else FALSE. */
  205.  
  206. #if  qNeedsMC68020
  207. const short qNeedsMC68020 = true;
  208. #else
  209. const short qNeedsMC68020 = false;
  210. #endif
  211.             /* If qNeedsMC68020 then this flag is TRUE else FALSE. */
  212.  
  213. #if  qNeedsMC68030
  214. const short qNeedsMC68030 = true;
  215. #else
  216. const short qNeedsMC68030 = false;
  217. #endif
  218.             /* If qNeedsMC68030 then this flag is TRUE else FALSE. */
  219.  
  220. #if  qNeedsROM128K
  221. const short qNeedsROM128K = true;
  222. #else
  223. const short qNeedsROM128K = false;
  224. #endif
  225.             /* If qNeedsROM128K then this flag is TRUE else FALSE. */
  226.  
  227. #if  qNeedsScriptManager
  228. const short qNeedsScriptManager = true;
  229. #else
  230. const short qNeedsScriptManager = false;
  231. #endif
  232.             /* If qNeedsScriptManager then this flag is TRUE else FALSE. */
  233.  
  234. #if  qNeedsStyleTextEdit
  235. const short qNeedsStyleTextEdit = true;
  236. #else
  237. const short qNeedsStyleTextEdit = false;
  238. #endif
  239.             /* If qNeedsStyleTextEdit then this flag is TRUE else FALSE. */
  240.  
  241. #if  qNeedsWaitNextEvent
  242. const short qNeedsWaitNextEvent = true;
  243. #else
  244. const short qNeedsWaitNextEvent = false;
  245. #endif
  246.             /* If qNeedsWaitNextEvent then this flag is TRUE else FALSE. */
  247.  
  248. #if  qPerform
  249. const short qPerform = true;
  250. #else
  251. const short qPerform = false;
  252. #endif
  253.             /* If qPerform then this flag is TRUE else FALSE. */
  254.  
  255. #if  qRangeCheck
  256. const short qRangeCheck = true;
  257. #else
  258. const short qRangeCheck = false;
  259. #endif
  260.             /* If qRangeCheck then this flag is TRUE else FALSE. */
  261.  
  262. #if  qTemplateViews
  263. const short qTemplateViews = true;
  264. #else
  265. const short qTemplateViews = false;
  266. #endif
  267.             /* If qTemplateViews then this flag is TRUE else FALSE. */
  268.  
  269. #if  qTrace
  270. const short qTrace = true;
  271. #else
  272. const short qTrace = false;
  273. #endif
  274.             /* If qTrace then this flag is TRUE else FALSE. */
  275.  
  276. #if  qExperimentalAndUnsupported
  277. const short qExperimentalAndUnsupported = true;
  278. #else
  279. const short qExperimentalAndUnsupported = false;
  280. #endif
  281.             /* If qExperimentalAndUnsupported then this flag is TRUE else FALSE. */
  282.  
  283. #endif
  284.             /*[f+]*/
  285.  
  286.             /* ASCII Character Constants */
  287. const short chBackspace            ='\b';                    /* ASCII code for Backspace character */
  288. const short chClear                ='\033';                /* ASCII code for Clear key (aka ESC) */
  289. const short chDown                ='\037';                /* ASCII code for down arrow */
  290. const short chEnd                ='\004';                /* ASCII code for the End key */
  291. const short chEnter                ='\003';                /* ASCII code for Enter character */
  292. const short chEscape            ='\033';                /* ASCII code for Escape (aka Clear) key */
  293. const short chFunction            ='\020';                /* ASCII code for any function key */
  294. const short chFwdDelete            ='\177';                /* ASCII code for forward delete */
  295. const short chHelp                ='\005';                /* ASCII code for Help key */
  296. const short chHome                ='\001';                /* ASCII code for the Home key */
  297. const short chLeft                ='\034';                /* ASCII code for left arrow */
  298. const short chPageDown            ='\f';                    /* ASCII code for Page Down key */
  299. const short chPageUp            ='\013';                /* ASCII code for Page Up key */
  300. const short chReturn            ='\n';                    /* ASCII code for Return character */
  301. const short chRight                ='\035';                /* ASCII code for right arrow */
  302. const short chSpace                =' ';                    /* ASCII code for Space character */
  303. const short chTab                ='\t';                    /* ASCII code for Tab character */
  304. const short chUp                ='\036';                /* ASCII code for up arrow */
  305.  
  306.             /* Virtual Key Code Constants */
  307. const short kClearVirtualCode    = 71;                    /* Clear key virtual code */
  308. const short kEscapeVirtualCode    = 53;                    /* Escape key virtual code */
  309. const short kF10VirtualCode        = 109;                    /* F10 virtual key code */
  310. const short kF11VirtualCode        = 103;                    /* F11 virtual key code */
  311. const short kF12VirtualCode        = 111;                    /* F12 virtual key code */
  312. const short kF13VirtualCode        = 105;                    /* F13 virtual key code */
  313. const short kF14VirtualCode        = 107;                    /* F14 virtual key code */
  314. const short kF15VirtualCode        = 113;                    /* F15 virtual key code */
  315. const short kF1VirtualCode        = 122;                    /* F1 virtual key code */
  316. const short kF2VirtualCode        = 120;                    /* F2 virtual key code */
  317. const short kF3VirtualCode        = 99;                    /* F3 virtual key code */
  318. const short kF4VirtualCode        = 118;                    /* F4 virtual key code */
  319. const short kF5VirtualCode        = 96;                    /* F5 virtual key code */
  320. const short kF6VirtualCode        = 97;                    /* F6 virtual key code */
  321. const short kF7VirtualCode        = 98;                    /* F7 virtual key code */
  322. const short kF8VirtualCode        = 100;                    /* F8 virtual key code */
  323. const short kF9VirtualCode        = 101;                    /* F9 virtual key code */
  324. const short kFwdDelVirtualCode    = 117;                    /* Forward Delete virtual code */
  325.  
  326. const short kSysFontName        = '\0';                    /* GetFontNum converts this to zero. */
  327. const short kApplFontName        = 'A';                    /* GetFontNum converts this to one. */
  328.  
  329. const short kWordAlign            = true;                    /* Constant for OffsetPtr */
  330. const short kDontAlign            = false;                /* Constant for OffsetPtr */
  331.  
  332. const unsigned char kHexDigits[]          = "\p0123456789ABCDEF"; /* Digits in base 16 */
  333.  
  334. const short kNoFileRefnum        = - (SHRT_MAX - 1);        /* an invalid file refnum; used to indicate
  335.                                                          an unopened file (actually interpreted by
  336.                                                          HFS as a volume number. If you have this
  337.                                                          many volumes you are sick indeed! */
  338. const short kNoStaticLink        = - 1;                    /* Pascal functions and procedures can take
  339.                                                          "procedure" parameters which are like C++
  340.                                                          function pointers with the additional
  341.                                                          capabilitly to access upscope variables.
  342.                                                          This is particularly convenient for "call
  343.                                                          back" type procedures because they are
  344.                                                          executed in their original scope. Well
  345.                                                          kids, C++ has no equivalent structure, so
  346.                                                          all of the interfaces that call for a
  347.                                                          "procedure" parameter have been translated
  348.                                                          to a function pointer and a static link
  349.                                                          (upscope variable accessor) in the C++
  350.                                                          headers. The static link can be used to
  351.                                                          pass any useful context information
  352.                                                          around, see the C++ examples. HOWEVER,
  353.  
  354.                                                          when a static link is not used or
  355.                                                          required; C++ users must insert a non-NIL
  356.                                                          placeholder. The receiving code is in
  357.                                                          pascal and includes special detection of
  358.                                                          the case where NIL is passed for static
  359.                                                          link. When NIL is passed in, >>> NO <<<
  360.                                                          static link will be passed to the
  361.                                                          "procedure" parameter when it is called!
  362.                                                          You can imagine the ensuing heartache for
  363.                                                          well meaning C++ users as their stack gets
  364.                                                          tromped. The answer, my friends is to have
  365.                                                          C++ users pass kNoStaticLink when they
  366.                                                          don't wish to use the static link. */
  367.  
  368.             /* Field types for the Fields methods. These are understood by StdFieldToString.
  369.             Negative values are reserved for MacApp.
  370.             */
  371. const short bBoolean            = - 1;
  372. const short bByte                = - 2;
  373. const short bChar                = - 3;
  374. const short bClass                = - 4;
  375. const short bCmdNumber            = - 5;
  376. const short bCntlAdornment        = - 6;
  377. const short bControlHandle        = - 7;
  378. const short bDouble                = - 8;                    /* SANE Double */
  379. const short bExtended            = - 9;                    /* SANE Extended */
  380. const short bFixed                = - 10;
  381. const short bFontName            = - 11;
  382. const short bGrafPtr            = - 12;
  383. const short bHandle                = - 13;
  384. const short bHexInteger            = - 14;
  385. const short bHexLongInt            = - 15;
  386. const short bHighByte            = - 16;
  387. const short bHLState            = - 17;
  388. const short bIDType                = - 18;
  389. const short bInteger            = - 19;
  390. const short bLongInt            = - 20;
  391. const short bLowByte            = - 21;
  392. const short bObject                = - 22;
  393. const short bOSType                = - 23;
  394. const short bPattern            = - 24;
  395. const short bPoint                = - 25;
  396. const short bPointer            = - 26;
  397. const short bReal                = - 27;                    /* Pascal Real */
  398. const short bRect                = - 28;
  399. const short bResType            = - 29;
  400. const short bRGBColor            = - 30;
  401. const short bRgnHandle            = - 31;
  402. const short bSingle                = - 32;                    /* SANE Single */
  403. const short bSizeDeterminer        = - 33;
  404. const short bString                = - 34;
  405. const short bStringHandle        = - 35;
  406. const short bStyle                = - 36;
  407. const short bTEHandle            = - 37;
  408. const short bTitle                = - 38;
  409. const short bVCoordinate        = - 39;
  410. const short bVPoint                = - 40;
  411. const short bVHSelect            = - 41;
  412. const short bVRect                = - 42;
  413. const short bWindowPtr            = - 43;
  414.  
  415. #if  0                                                    /* !!! can't fieldtostring for multiline
  416.                                                          structures yet (2.0)*/
  417. const short bTextStyle            = - 44;
  418. const short bConfigRec            = - 45;
  419. const short bScrapStuff            = - 46;
  420. #endif
  421. const short kMANameSize            = 63;                    /* Maximum size string supported for an
  422.                                                          MAName */
  423.  
  424. const short kAutoWrap            = true;                    /* Want to AutoWrap (for MATextBox)*/
  425. const short kNoAutoWrap            = ! kAutoWrap;            /* Don't want to AutoWrap (for MATextBox)*/
  426. const short kEraseFirst            = true;                    /* Want to erase first (for MATextBox)*/
  427. const short kNoEraseFirst        = ! kEraseFirst;
  428.    /* Don't want to erase first (for MATextBox)*/
  429. const short kSpaceForCaret        = true;
  430.    /* Want to leave space for an insertion caret
  431.                                                         (for MATextBox)*/
  432. const short kNoSpaceForCaret    = ! kSpaceForCaret;
  433.    /* Don't want to leave space for an insertion 
  434.                                                         caret (for MATextBox)*/
  435. const short teJustSystem        = teJustLeft;            /* teJustLeft really means use the system
  436.                                                         justification set by the installed script.
  437.                                                         in Arabic and Hebrew systems thi
  438.    s is typically
  439.                                                         right justification (but user changeable).
  440.                                                         using a constant with a better name like
  441.                                                         teJustSystem helps to make this issue more
  442.                                                         visible to the developer.  If LEFT
  443.                                                         justification is REQUIRED there 
  444.    is of course,
  445.                                                         teForceLeft. */
  446.             /* Some handy types */
  447.             /* MacApp used to indicate the pointer datatype by prepending the type name with a "P"
  448.             and a handle datatype by prepending the type name with a "H".  In order to be more
  449.             compatible with the standards used in the toolbox interfaces we will now ind
  450.    icate pointer
  451.             datatypes by appending "Ptr" to the typename and handle datatypes by appendi
  452.    ng "Handle" to
  453.             the typename.  The old style names are left in for compatibility in Release 2.0 */
  454.  
  455. typedef short *IntegerPtr;                                /* Preferred */
  456. typedef IntegerPtr *IntegerHandle;                        /* Preferred */
  457.  
  458. typedef long *LongIntPtr;                                /* Preferred */
  459. typedef LongIntPtr *LongIntHandle;                        /* Preferred */
  460.  
  461. typedef Boolean *BooleanPtr;                            /* Preferred */
  462. typedef BooleanPtr *BooleanHandle;                        /* Preferred */
  463.  
  464. typedef SignedByte *SignedBytePtr;                        /* Preferred */
  465. typedef SignedBytePtr *SignedByteHandle;                /* Preferred */
  466.  
  467. typedef IntegerPtr PInteger;                            /* Left in for compatibility (2.0) */
  468. typedef IntegerHandle HInteger;                            /* Left in for compatibility (2.0) */
  469. typedef LongIntPtr PLongInt;                            /* Left in for compatibility (2.0) */
  470. typedef LongIntHandle HLongInt;                            /* Left in for compatibility (2.0) */
  471. typedef BooleanPtr PBoolean;                            /* Left in for compatibility (2.0) */
  472. typedef SignedBytePtr PByte;                            /* Left in for compatibility (2.0) */
  473.  
  474. typedef unsigned char String8[9];
  475.  
  476. typedef unsigned char MAName[64];                        /* A Name in MacApp®. ClassNames,
  477.  
  478.                                                          MethodNames, IVar Names, ProcNames, etc.
  479.                                                          ??? Should we punt on stringlength and
  480.                                                          only define pointers to these strings? */
  481. typedef StringPtr *MANamePtr;                            /* Preferred */
  482. typedef StringPtr **MANameHandle;                        /* Preferred */
  483. typedef StringPtr *PMAName;                                /* Left in for compatibility (2.0) */
  484. typedef MANameHandle HMAName;                            /* Left in for compatibility (2.0) */
  485.  
  486. typedef ResType IDType;                                    /* MacApp uses four byte "signatures" in
  487.                                                          several places. They are a handy way to
  488.                                                          have a partially human readable quantity
  489.                                                          that only takes up a long. */
  490.  
  491. /* Draw drop shadows against framed selections */
  492. const unsigned char adnLineTop            = (1<<0);
  493. const unsigned char adnLineLeft            = (1<<1);
  494. const unsigned char adnLineBottom        = (1<<2);
  495. const unsigned char adnLineRight        = (1<<3);
  496. const unsigned char adnDummy            = (1<<4);
  497. const unsigned char adnOval                = (1<<5);
  498. const unsigned char adnRRect            = (1<<6);
  499. const unsigned char adnShadow            = (1<<7);
  500.  
  501. typedef unsigned char CntlAdornment;
  502.  
  503. typedef long VCoordinate;                                /* VCoordinates are 32 bits as compared to QD
  504.                                                          Coordinates which are 16 bits */
  505.  
  506. struct VPoint {
  507.     VCoordinate v, h;
  508.     pascal void IPoint(VCoordinate ah, VCoordinate av) { v=av; h=ah; };
  509. };
  510.  
  511. struct VRect {
  512.     VCoordinate top,left,bottom,right;
  513.     pascal void IRect(VCoordinate atop, VCoordinate aleft, VCoordinate abottom, VCoordinate aright)
  514.     { top=atop; left=aleft; bottom=abottom; right=aright; };
  515. };
  516.  
  517. struct ConfigRecord {                                    /* ??? should this be PACKED ??? if so, how
  518.                                                          will this affect C++ users? */
  519.             /* Values from SysEnvirons (Version 1) */
  520.     short environsVersion;
  521.     short machineType;
  522.     short systemVersion;
  523.     short processor;
  524.     Boolean hasFPU;
  525.     Boolean hasColorQD;
  526.     short keyboardType;
  527.     short atDrvrVersNum;
  528.     short sysVRefNum;
  529.                                 /* Derived values */
  530.     Boolean hasROM128K;                                    /* ROM 128K - OR - Better */
  531.     Boolean hasHFS;
  532.  
  533.     Boolean hasHierarchicalMenus;
  534.     Boolean hasScriptManager;
  535.     Boolean hasStyleTextEdit;
  536.     Boolean hasSoundManager;
  537.     Boolean hasWaitNextEvent;
  538.     Boolean hasSCSI;
  539.     Boolean hasDesktopBus;
  540.     Boolean hasAUX;
  541.     Boolean hasTempMem;                                    /* TRUE if Multifinder™ temp memory is avail
  542.                                                          */
  543.     Boolean has32BitQD;                                    /* TRUE if 32 bit Quickdraw is installed */
  544. };
  545.  
  546. #if  qDebug
  547. extern pascal Boolean gPreCondition;                    /* true to do pre-condition processing */
  548. extern pascal Boolean gPostCondition;                    /* true to do post-condition processing */
  549. #endif
  550. extern pascal short gApplicationRefNum;                    /* RefNum of the application's res file. */
  551. extern pascal ConfigRecord gConfiguration;                /* The _actual_ environment configuration */
  552. extern pascal short gMBarHeight;                        /* Height of the menu bar in pixels */
  553.  
  554. extern pascal unsigned char gBoolString[2][6];                  /* Used to display boolean values. */
  555.             /*$Push*/ /*$J+*/
  556. extern pascal Ptr GFIELDTOSTRRTN;
  557.    /* Routine that converts fields to strings. */
  558.             /*$Pop*/
  559.  
  560.             /*$Push*/ /*$J+*/
  561. extern pascal Boolean gToolBoxInitialized;                /* Indicates whether toolbox has been inited
  562.                                                          */
  563. extern pascal Boolean gUDialogInitialized;                /* Indicates whether UDialog has been inited
  564.                                                          */
  565. extern pascal Boolean gUGridViewInitialized;            /* Indicates whether UGridView has been
  566.                                                          inited */
  567. extern pascal Boolean gUPrintingInitialized;            /* Indicates whether UPrinting has been
  568.                                                          inited */
  569. extern pascal Boolean gUTEViewInitialized;                /* Indicates whether UTEView has been inited
  570.                                                          */
  571. extern pascal Ptr gStrippedAddress;                        /* an address already stripped by
  572.                                                          StripAddress */
  573.             /*$Pop*/
  574.  
  575. extern pascal RGBColor gRGBBlack,                        /* RGB representation for black. */
  576. gRGBWhite;                                                /* RGB representation for white. */
  577. extern pascal RgnHandle gCursorRgn;                        /* the current cursor region that will be
  578.                                                          passed to WaitNextEvent as the sleep
  579.                                                          region */
  580. extern pascal Boolean gDeadStripSuppression;            /* Dynamically set to false. Condition the
  581.                                                          execution of a New(aTFoo) to suppress the
  582.                                                          dead-stripping of support for a TFoo */
  583. extern pascal Boolean gCreateWithTemplates;
  584.    /* Same as gDeadStripSuppression. Left in for
  585.                                                          compatibility (2.0) */
  586.  
  587. extern pascal TEHandle gMATextBoxTE;                    /* a working TEHandle for use exclusively by
  588.                                                          MATextBox. Keeps us from having to
  589.                                                          continually allocate and dispose a TE
  590.                                                          (like TextBox does) */
  591.  
  592. extern pascal Ptr gTEDefaultWordBreak;
  593.    /* The default word break routine used by TE.
  594.                                                          NOTE that _this_ routine (alone) does not
  595.                                                          take parameters using the Pascal calling
  596.                                                          conventions as required by SetWordBreak
  597.                                                          (Thank you TE!) and must be set in the TE
  598.                                                          by munging (Rhymes with plunging) the
  599.                                                          wordBreak field directly. */
  600.  
  601.             /* S T A R T U P   U T I L I T I E S */
  602.  
  603. extern pascal void InitToolBox(void);
  604.         /* Essential toolbox and utility initialization. */
  605.  
  606. extern pascal void DefineConfiguration(ConfigRecord *configuration);
  607.         /* Fills the configuration record for the host machine. */
  608.  
  609. extern pascal Boolean ValidateConfiguration(ConfigRecord *configuration);
  610.         /* FALSE if compiled configuration doesn't match runtime config */
  611.  
  612.         /* M I S C E L L A N E O U S   U T I L I T I E S */
  613.  
  614.         /* >>> NOTE <<<
  615.         Use the following accessors _wisely_ since they can play real havoc with inter-language
  616.         portability. These routines used to begin with %_ but, that was dropped since it translates
  617.         into the reserved __ in C++.
  618.         */
  619.  
  620. pascal long GetParmBlockPtr(void)
  621.     =  0x2E88;                                            /* MOVE.L A0,(A7) */
  622.         /* Formerly, %_GetA0. Return the value of register A0.  Useful for getting the pointer
  623.         to the parameter block from a VBL task or a completion routine. */
  624.  
  625. pascal long GetA5(void)
  626.     =  0x2E8D;                                            /* MOVE.L A5,(A7) */
  627.         /* Formerly, %_GetA5. Return the value of register A5. Useful for getting the immediate 
  628.            value
  629.         of A5 which is not always the same as CurrentA5.  Generally a pointer to the program's
  630.         global area and jump table. */
  631.  
  632. pascal Ptr GetCurStackFramePtr(void)
  633.     =  0x2E8E;                                            /* MOVE.L A6,(A7) */
  634.         /* Formerly, %_GetA6. Return the value of register A6.  Usually a pointer to the local stack
  635.         frame.  Most often used to find out the caller's name when invoking a debugging routine. */
  636.  
  637. pascal Ptr GetCurStackTop(void)
  638.     =  0x2E8F;                                            /* MOVE.L A7,(A7) */
  639.         /* Formerly, %_GetA7. Return the value of register A7.  Usually the top of stack.  Useful
  640.         for stack sniffing (not a crime). */
  641.  
  642.       /*--------------------------------------------------------------------------------------
  643.          ------*/
  644.  
  645. extern pascal void BlockSet(Ptr destPtr, long byteCount, SignedByte setVal);
  646.         /* Sets a block of memory to a value.  */
  647.  
  648. extern pascal void CenterRectOnScreen(Rect *aRect, Boolean horizontally, Boolean vertically, Boolean
  649.     forDialog);
  650.         /* Horizontally and/or vertically centers the given rectangle on the main screen. If for
  651.            Dialog
  652.         is true then the rect is vertically centered closer to the top of the screen as for a modal
  653.         dialog. */
  654.  
  655. extern pascal short CompareStrings(StringPtr first, StringPtr second);
  656.         /* Returns -1, 0, or 1 if first <, =, or > second. */
  657.  
  658. extern pascal void CopyStr255(StringPtr fmStr, void *toAddr);
  659.         /* Copies a string, copying ONLY what's necessary */
  660.  
  661. extern pascal void EachWMgrWindowDo(pascal void (*DoToWMgrWindow)(GrafPtr theWMgrWindow, void *
  662.    DoToWMgrWindow_StaticLink), void *DoToWMgrWindow_StaticLink);
  663.         /* Calls DoToWMgrWindow for each window in the windowlist starting at FrontWindow.  */
  664.  
  665. extern pascal GrafPtr FindWindowBefore(GrafPtr theWindow);
  666.         /* returns the window just before a given window. Returns nil if the given window is fro
  667.            ntmost
  668.         or not found. */
  669.  
  670. pascal Ptr PRStr(StringPtr astr)
  671.     =  0x2E9F;                                            /* Move.L (A7)+,(A7) */
  672.         /* For brain-damaged compiler, which can't pass the address of a string in a packed record,
  673.  
  674.         even though it has to be byte-aligned by definition. Sure, maybe it's not word a
  675.    ligned, but for a
  676.         BlockMove we don't care. When calling CopyStr255 where the destination is the address of a
  677.         Str255 in a packed record, call it like this: CopyStr255(fromStr, PRStr(packedStr)); */
  678.  
  679. pascal StringPtr AtStr(StringPtr astr)
  680.     =  0x2E9F;                                            /* Move.L (A7)+,(A7) */
  681.         /* Lets you take the address of a string constant so you can pass pointers with no stack
  682.             copy.
  683.         Use it like this: AtStr('Foo'); */
  684.  
  685. pascal StringPtr *AtMAName(StringPtr astr)
  686.     =  0x2E9F;                                            /* Move.L (A7)+,(A7) */
  687.         /* Lets you take the address of a string constant so you can pass pointers with no stack
  688.             copy.
  689.         Use it like this: AtMAName('Bar'); */
  690.  
  691. extern pascal void PullApplicationToFront(void);
  692.         /* Applications don't start as the frontmost layer under MultiFinder™. They come to the 
  693.            front
  694.         after a few Event calls. If you have a splash screen at startup then you probably want to
  695.         use this call. */
  696.  
  697. extern pascal void DefaultSize(short *theSize);
  698.         /* If theSize is equal to the system font size then theSize is set to zero. Otherwise it is
  699.         left unchanged. The purpose of this routine is to convert a font size to portable form,
  700.  
  701.         where a font size of zero is the portable equivalent to the system font size. */
  702.  
  703. extern pascal void *DisposeIfHandle(void *aHandle);
  704.         /* Disposes the handle only if it is non-NIL.
  705.         Returns NIL for convenient assignment back to the reference passed in. */ /* Preferred */
  706.  
  707. extern pascal void *DisposeIfPtr(void *aPtr);
  708.         /* Disposes the pointer only if it is non-NIL.
  709.         Returns NIL for convenient assignment back to the reference passed in. */ /* Preferred */
  710.  
  711. extern pascal void DisposIfHandle(void *aHandle);        /* Left in for compatibility (2.0) */
  712.  
  713. extern pascal void DisposIfPtr(void *aPtr);                /* Left in for compatibility (2.0) */
  714.  
  715. extern pascal Boolean EqualBlocks(void *first, void *second, short theSize);
  716.         /* Returns true if the two blocks pointed at by first and second are equal over theSize
  717.         bytes.*/
  718.  
  719. extern pascal void FieldToString(Ptr theData, short fieldType, StringPtr theString);
  720.         /* Calls the routine whose address is stored in gFieldToStrRtn. Its purpose is to take some
  721.         data pointed to by theData, and whose type is indicated by field type, and convert that
  722.         data into a string representation. By default, gFieldToStrRtn points to StdFieldToString. */
  723.  
  724. extern pascal short GetActualJustification(short justification);
  725.         /* If the justification passed in is teJustSystem then returns teJustLeft or teJustRight
  726.         depending on the setting of the system justification.  Other justifications are just passed
  727.         through to the result. */
  728.  
  729. extern pascal short GetFontNum(StringPtr fontName);
  730.         /* Returns the font number corresponding to the given name. If fontName is equal to
  731.         kSysFontName then zero is returned. If fontName is equal to kApplFontName then 1 is
  732.         returned. Otherwise the Toolbox routine GetFNum is called to get the font number. */
  733.  
  734. extern pascal SignedByte GetHandleBits(Handle h);
  735.         /* Return the flag byte of a handle.  Left in for compatibility (2.0) */
  736.  
  737. #if  ! qNeedsColorQD
  738.  
  739. extern pascal void GetIfColor(RGBColor *aColor);
  740.         /* If flag qNeedsColorQD is FALSE then use this method, otherwise use the one below. */
  741. #else
  742.  
  743. pascal void GetIfColor(RGBColor *aColor)
  744.     = {0xaa19/* _GetForeColor*/};
  745. #endif
  746.         /* Fetches current foreground color.  Works for both old and new QuickDraw. */
  747.  
  748. #if  ! qNeedsColorQD
  749.  
  750. extern pascal void GetIfBkColor(RGBColor *aColor);
  751.         /* If flag qNeedsColorQD is FALSE then use this method, otherwise use the one below. */
  752. #else
  753.  
  754. pascal void GetIfBkColor(RGBColor *aColor)
  755.     = {0xaa1a/* _GetBackColor*/};
  756. #endif
  757.         /* Fetches current background color.  Works for both old and new QuickDraw. */
  758.  
  759. extern pascal void GetPortTextStyle(TextStyle *theTextStyle);
  760.         /* Returns the textStyle representing the current state of thePort. */
  761.  
  762. extern pascal void GetPortFontInfo(short fontNum, StringPtr fontName, short *fontSize);
  763.         /* Returns the font name corresponding to a given name, in portable format. i.e. if font
  764.            Num is
  765.         the system font then kSysFontName is returned; if fontNum is the application font then
  766.         kApplFontName is return; otherwise the Toolbox routine GetFontName is called to get the
  767.         font name. Then, if fontNum is the system or application font, a 0 is returned if the size
  768.         is the default size. */
  769.  
  770. extern pascal TrapType GetTrapType(short theTrap);
  771.         /* Returns the trap's type (OSTrap or ToolTrap). */
  772.  
  773. pascal long IntMultiply(short x, short y)
  774.     =  {0x301F,                                            /* MOVE.W (A7)+,D0 */
  775. 0xC1DF,                                                    /* MULS.W (A7)+,D0 */
  776. 0x2E80};                                                /* MOVE.L D0,(A0) */
  777.         /* Multiplies two integers and returns a longint result. Note that the Pascal compiler will
  778.         generate a 16-bit result if you say n := x * y, truncating the upper 16-bits. Furthermore,
  779.  
  780.         if either x or y is a longint then the compiler expands both operands to 32-bits and calls
  781.         a 32-bit multiply subroutine. IntMultiply avoids these problems. */
  782.  
  783. extern pascal Boolean IsHandle(void *h);
  784.         /* Returns true or false for handlehood of h */
  785.  
  786. extern pascal Boolean IsHandleLocked(void *h);
  787.         /* Returns lockState of h */
  788.  
  789. #if  qDebug
  790.  
  791. extern pascal Boolean IsHandlePurged(void *h);
  792.         /* Returns purgeState of h */
  793. #else
  794.  
  795. pascal Boolean IsHandlePurged(void *h)
  796.     =  {0x205F,                                            /* MOVE.L (A7)+,A0 */
  797. 0x4A90,                                                    /* TST.L (A0) */
  798. 0x57D7,                                                    /* SEQ (A7) */
  799. 0x4417};                                                /* NEG.B (A7) */
  800.         /* Returns purgeState of h */
  801. #endif
  802.  
  803. extern pascal short LengthRect(Rect *r, VHSelect vhs);
  804.         /* If vhs is v, returns the length of r; else returns the width of r. */
  805.  
  806. extern pascal void LockHandleHigh(Handle h);
  807.         /* Convenience function.  Moves a handle high (MoveHHi) and locks it (HLock).  The two
  808.         operations are very frequently performed together thus, this procedure.  Ignores NIL
  809.         handles. */
  810.  
  811. extern pascal VHSelect LongerSide(Rect *r);
  812.         /* Return an indication of which side is longer. */
  813.  
  814. extern pascal void LIntToHex(long decNumber, StringPtr hexNumber, short noOfDigits);
  815.         /* LIntToHex converts decNumber to a hexidecimal string of noOfDigits length. */
  816.  
  817. extern pascal short MAUseResFile(short refNum);
  818.         /* Like the ToolBox UseResFile but, it also returns the old CurResFile setting */
  819.  
  820. extern pascal void MATextBox(Ptr text, long itsLength, Rect *box, short itsJust, Boolean autoWrap, 
  821.    Ptr wordBreak, Boolean eraseFirst, Boolean spaceForCaret);
  822.         /* Like the toolbox TextBox but, it also gives you control over whether the text should
  823.         word-wrap with autoWrap, whether the box should be erased first with eraseFirst and, if
  824.         word-wrap is specified, where the word breaks should be with wordBreak (pass NIL to use
  825.         the default word-wrap routine in TE.  Since TextBox uses TE to image the text,
  826.  
  827.         spaceForCaret lets us adjust the drawn text by 1 pixel (the insertion caret) on the left and
  828.         right.  If the text is editable or could become editable (as in TEditText) you probably want
  829.         to leave space for a caret.  If the text is a title or something then you probably don't
  830.         want to leave space for a caret.*/
  831.  
  832. extern pascal void MADrawString(StringPtr s, Rect *box, short justification);
  833.         /* A convenience routine.  Like the toolbox DrawString but, it uses a StringPtr to help
  834.         reduce stack space requirements. And It also gives you control over
  835.         the bounds into which the text will be drawn and draws it in the correct international
  836.         direction.  This routine is _MUCH_ slower than DrawString. */
  837.  
  838. pascal long Max(long a, long b)
  839.     =  {0x201F,                                            /* MOVE.L (A7)+,D0 */
  840. 0x2E9F,                                                    /* MOVE.L (A7)+,(A7) */
  841. 0xB097,                                                    /* CMP.L (A7),D0 */
  842. 0x6F02,                                                    /* BGE.S *+4 */
  843. 0x2E80};                                                /* MOVE.L D0,(A7) */
  844.         /* Returns the maximum of a and b. */
  845.  
  846. pascal long Min(long a, long b)
  847.     =  {0x201F,                                            /* MOVE.L (A7)+,D0 */
  848. 0x2E9F,                                                    /* MOVE.L (A7)+,(A7) */
  849. 0xB097,                                                    /* CMP.L (A7),D0 */
  850. 0x6C02,                                                    /* BLE.S *+4 */
  851. 0x2E80};                                                /* MOVE.L D0,(A7) */
  852.         /* Returns the minimum of a and b. */
  853.  
  854. extern pascal long MinMax(long MinVal, long expression, long MaxVal);
  855.         /* Returns the expression bounded by minimum and maximum */
  856.  
  857. extern pascal void NumberToHex(long theNumber, StringPtr hexString, short hexDigits);
  858.         /* Converts theNumber to a hex string preceeded with '$'.*/
  859.  
  860. extern pascal long PinOnRect(Rect *theRect, Point thePt);
  861.         /* Like PinRect except that if thePt.h (or v) is >= theRect.right (bottom) it returns
  862.         theRect.right (bottom). PinRect returns 1 less than that except if thePt is exactly on the
  863.         edge of theRect.*/
  864.  
  865. extern pascal long StripLong(void *address);
  866.         /* same function as the glue/trap stripAddress only the types are long and modified to b
  867.            ypass
  868.         the inefficient MPW glue!!.  If inlines could reference relocatables it could ev
  869.    en be inline. */
  870.  
  871. extern pascal void PointerToHex(long theNumber, StringPtr hexString, short hexDigits);
  872.         /* If theNumber is zero, then hexString is set to 'Nil'. Else theNumber is converted to 
  873.            a hex
  874.         string preceeded with '$'.*/
  875.  
  876. extern pascal Boolean RectsNest(Rect *outer, Rect *inner);
  877.         /* Determine if inner nests within outer. */
  878.  
  879. extern pascal Boolean VRectsNest(VRect *outer, VRect *inner);
  880.         /* Determine if inner nests within outer for VCoordinates. */
  881.  
  882. extern pascal long RoundUp(long aNumber, short aModulus);
  883.         /* Rounds aNumber up so that it is evenly divisible by aModulus. */
  884.  
  885. extern pascal short SetKeyScript(short newKeyScript);
  886.         /* If newKeyScript is different from the current key script, then the key script is set to
  887.         newKeyScript. (The reason we don't want to set the key script to the same thing is that the
  888.         Script Mgr. does a FlushEvents when it sets the key script.) */
  889.  
  890. extern pascal void SetHandleBits(Handle h, SignedByte theBits);
  891.         /* Sets the flag byte of a handle. Left in for compatibility (2.0) */
  892.  
  893. #if  ! qNeedsColorQD
  894.  
  895. extern pascal void SetIfColor(const RGBColor *aColor);
  896.         /* If flag qNeedsColorQD is FALSE then use this method, otherwise use the one below. */
  897. #else
  898.  
  899. pascal void SetIfColor(const RGBColor *aColor)
  900.     = {0xaa14/* _RGBForeColor*/};
  901. #endif
  902.         /* Sets foreground color.  Works for both old and new QuickDraw. */
  903.  
  904. #if  ! qNeedsColorQD
  905.  
  906. extern pascal void SetIfBkColor(const RGBColor *aColor);
  907.         /* If flag qNeedsColorQD is FALSE then use this method, otherwise use the one below. */
  908. #else
  909.  
  910. pascal void SetIfBkColor(const RGBColor *aColor)
  911.     = {0xaa15/* _RGBBackColor*/};
  912. #endif
  913.         /* Sets background color.  Works for both old and new QuickDraw. */
  914.  
  915. extern pascal void SetPortTextStyle(TextStyle *theTextStyle);
  916.         /* Sets the font style of the current port to the characteristics of theTextStyle. */
  917.  
  918. extern pascal void SetRGBColor(RGBColor *RGB, short red, short green, short blue);
  919.         /* Sets RGB to the given colors. */
  920.  
  921. extern pascal void SetTextStyle(TextStyle *theTextStyle, short theFont, unsigned short theStyle, 
  922.    short theSize, RGBColor *theColor);
  923.         /* Sets theTextStyle to the given characteristics */
  924.  
  925. extern pascal void StdFieldToString(Ptr theData, short fieldType, StringPtr theString);
  926.         /* This routine converts all field types defined by the constants in this unit. */
  927.  
  928. extern pascal void ScrapStuffFields(StringPtr aTitle, ScrapStuff *aScrapStuff, pascal void (*
  929.    DoToField)(StringPtr fieldName, Ptr fieldAddr, short fieldType, void *DoToField_StaticLink), void
  930.     *DoToField_StaticLink);
  931.         /* Used to inspect the fields of a ScrapStuff. */
  932.  
  933. extern pascal void TextStyleFields(StringPtr aTitle, TextStyle *aStyle, pascal void (*DoToField)(
  934.    StringPtr fieldName, Ptr fieldAddr, short fieldType, void *DoToField_StaticLink), void *
  935.    DoToField_StaticLink);
  936.         /* Used to inspect the fields of a TextStyle record. */
  937.  
  938. extern pascal void ConfigRecFields(StringPtr aTitle, ConfigRecord *aConfigRec, pascal void (*
  939.    DoToField)(StringPtr fieldName, Ptr fieldAddr, short fieldType, void *DoToField_StaticLink), void
  940.     *DoToField_StaticLink);
  941.         /* Used to inspect the fields of a Config record. */
  942.  
  943. extern pascal Boolean TrapExists(short theTrap);
  944.         /* Returns true if the given trap exists at run-time */
  945.  
  946. extern pascal short UprChar(short ch);
  947.         /* Returns ch converted to upper case */
  948.  
  949. extern pascal void UprStr255(StringPtr s);
  950.         /* Converts s to all upper case. */
  951.  
  952. extern pascal void UprMAName(StringPtr s);
  953.         /* Converts s to all upper case. */
  954.  
  955. extern pascal short LowerChar(short ch);
  956.         /* Returns ch converted to lower case */
  957.  
  958. extern pascal void LowerStr255(StringPtr s);
  959.         /* Converts s to all lower case. */
  960.  
  961. pascal void UseSelectionColor(void)
  962.     =  {0x08B8, 0x0007,0x0938/* kLMHiliteMode*/};        /* BCLR #$07,kLMHiliteMode */
  963.         /* Call to make the next (and only the next) QD operation use the selection color. */
  964.  
  965. extern pascal void UseROMMap(Boolean resLoad);
  966.         /* Call this before any Resource Manager call for which you might like to use ROM resources.
  967.         Remember, if you pass FALSE to this then you should call SetResLoad(TRUE) afterwards. */
  968.  
  969. extern pascal void WithApplicationResFileDo(pascal void (*DoWithResFile)(void *
  970.    DoWithResFile_StaticLink), void *DoWithResFile_StaticLink);
  971.         /* Performs a proc with the application res file as the curResFile restoring the prev se
  972.            tting
  973.         at completion. */
  974.  
  975.         /* F I L E   U T I L I T I E S */
  976.  
  977. extern pascal OSErr CloseFile(short dataRefnum, short rsrcRefnum);
  978.         /* Closes the data and resource forks of a file. If dataRefnum = kNoFileRefnum then the data
  979.         fork is not closed. Likewise, if rsrcRefnum = kNoFileRefnum then the resource fork is not
  980.         closed. Returns noErr if successful, else an O.S. error. */
  981.  
  982. extern pascal OSErr DeleteFile(StringPtr namePtr, short volRefnum);
  983.         /* Deletes the specified file; uses FillInDirID to bypass the Poor Man's Search Path. */
  984.  
  985. extern pascal long FileModDate(StringPtr name, short volRefnum);
  986.         /* Returns file modification date or 0 if an I/O error occurs */
  987.  
  988. extern pascal OSErr FillInDirID(HParmBlkPtr pb);
  989.         /* Based on the ioVRefnum field of pb^, looks up the dirID of the working directory and 
  990.            fills
  991.         it into the ioDirID field. If HFS is not installed, it sets the ioDirID to 0. This is used
  992.         to inhibit the PMSP. After setting up your HParamBLockRec, call this to fill in the dirID
  993.         and then make the H form of the call (eg., PBHGetFInfo rather than PBGetFInfo). */
  994.  
  995. extern pascal OSErr GetDirID(short *vRefnum, long *dirID);
  996.         /* Returns the dirID corresponding to a given wdRefnum; changes vRefnum to be a real volume
  997.         refnum. */
  998.  
  999. extern pascal OSErr GetFileInfo(StringPtr name, short volRefnum, HParamBlockRec *info);
  1000.         /* Makes a PBHGetFInfo call, and returns result in info. Bypasses PMSP. */
  1001.  
  1002. extern pascal long NumBlocks(long numBytes, long blkSize);
  1003.         /* Returns the number of blocks required to store numBytes, given that the block size is
  1004.         blkSize. */
  1005.  
  1006. extern pascal OSErr MAOpenFile(StringPtr name, short volRefnum, Boolean openData, Boolean openRsrc, 
  1007.    short dataPerm, short rsrcPerm, short *dataRefnum, short *rsrcRefnum);
  1008.         /* Open the specified forks of the file using the specified permissions. Returns kNoFile
  1009.            Refnum
  1010.         for refnums that are not (or cannot) be opened. On 64K ROM machines, rsrcPerm is ignored.
  1011.         Returns an O/S error if the data fork does not exist; returns a rsrcRefnum of kNoFileRefnum
  1012.         if the resource fork does not exist. Returns an O/S error for all other errors. If no error
  1013.         occurs, returns NoErr. */
  1014.  
  1015.         /* D E B U G G I N G   U T I L I T I E S */
  1016.  
  1017. extern pascal Str255 ConcatNumber(StringPtr aString, long aNumber);
  1018.         /* Returns aString appended with the string representation of aNumber */
  1019.  
  1020. extern pascal Boolean CanReadLn(void);
  1021.         /* returns TRUE if WritelnWindow is available and the display is not suppressed */
  1022.  
  1023. extern pascal Boolean CanWriteLn(void);
  1024.         /* returns TRUE if WritelnWindow is available */
  1025.  
  1026. extern pascal short ReadInteger(StringPtr prompt);
  1027.         /* Displays prompt and reads an integer from the debug window. */
  1028.  
  1029. extern pascal Boolean ReadYesNo(StringPtr prompt);
  1030.         /* Displays prompt and accepts a 'y' or 'n' as input from the debug
  1031.         window. */
  1032.  
  1033. extern pascal Boolean VerboseIsHandle(void *h);
  1034.         /* Returns true if h is really a handle. If not then it prints diagnostic info about the
  1035.         alleged handle. */
  1036.  
  1037. extern pascal void WritePt(Point pt);
  1038.         /* Writes the point in the debug window. */
  1039.  
  1040. extern pascal void WritePtr(long val);
  1041.         /* Writes the pointer, in hex, in the debug window. */
  1042.  
  1043. extern pascal void WriteRect(Rect *r);
  1044.         /* Writes the rectangle in the debug window. */
  1045.  
  1046. extern pascal void WriteBoolean(Boolean b);
  1047.         /* Writes the boolean in the debug window. */
  1048.  
  1049. extern pascal void WriteVPt(VPoint *pt);
  1050.         /* Writes the VPoint in the debug window. */
  1051.  
  1052. extern pascal void WriteVRect(VRect *r);
  1053.         /* Writes the VRect in the debug window. */
  1054.  
  1055. extern pascal void WrLblPt(StringPtr aLabel, Point pt);
  1056.         /* Writes the label, ' = ', the point, to the debug window. */
  1057.  
  1058. extern pascal void WrLblPtr(StringPtr aLabel, long val);
  1059.         /* Writes the label, ' = ', the pointer in hex, to the debug window. */
  1060.  
  1061. extern pascal void WrLblRect(StringPtr aLabel, Rect *r);
  1062.         /* Writes the label, ' = ', the rectangle, to the debug window. */
  1063.  
  1064. extern pascal void WrLblBoolean(StringPtr aLabel, Boolean b);
  1065.         /* Writes the label, ' = ', the boolean, to the debug window. */
  1066.  
  1067. extern pascal void WrLblVPt(StringPtr aLabel, VPoint *pt);
  1068.         /* Writes the label, ' = ', the VPoint in the debug window. */
  1069.  
  1070. extern pascal void WrLblVRect(StringPtr aLabel, VRect *r);
  1071.         /* Writes the lable, ' = ', the VRect in the debug window. */
  1072.  
  1073. extern pascal void WriteSig(ResType theID);
  1074.         /* Writes out an IDType signature. */
  1075.  
  1076. extern pascal void WrLblSig(StringPtr theLabel, ResType theID);
  1077.         /* Writes the label, ' =', theID in the debug window. */
  1078.  
  1079. extern pascal void WrLblHandleContents(StringPtr aLabel, void *theHandle);
  1080.         /* Writes the label, ' =', theHandle in the debug window. */
  1081.  
  1082. extern pascal void WriteHandleContents(void *theHandle);
  1083.         /* Writes theHandle  in the debug window. */
  1084.  
  1085. extern pascal void WriteHexInt(short theInt);
  1086.         /* Writes theInt  in the debug window. */
  1087.  
  1088. extern pascal void WrLblHexInt(StringPtr theLabel, short theInt);
  1089.         /* Writes the label, ' =', theInt in the debug window. */
  1090.  
  1091. extern pascal void WriteHexLongint(long theLongint);
  1092.         /* Writes theLongint  in the debug window. */
  1093.  
  1094. extern pascal void WrLblHexLongint(StringPtr theLabel, long theLongint);
  1095.         /* Writes the label, ' =', theLongint in the debug window. */
  1096. #endif
  1097.  
  1098.